import { state } from './modules/state'
import { user } from './modules/user'

export interface IAppStore {
	state: ReturnType<typeof state>
	user: ReturnType<typeof user>
}

// store仓库
const appStore: IAppStore = {} as IAppStore

// 导出全局注册函数
export const createStore = () => {
	appStore.state = state()
	appStore.user = user()
}

export default appStore
